<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <link href="/static/layui/css/layui.css" rel="stylesheet" type="text/css">
</head>
<div style="padding:10px 50px 10px 10px">
    <form id="recordForm" class="layui-form">
        <div style="margin-bottom:20px;font-size:14px;border-bottom:1px solid #ccc; padding-bottom: 5px;">订单信息</div>
        <input type="hidden" name="id" value="${record.id}"/>
        <div class="layui-form-item">
            <label class="layui-form-label">实验室</label>
            <div class="layui-form-label">
                ${areaMap.get(record.area)}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">房间</label>
            <div class="layui-input-block">
                ${record.room}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设备编号</label>
            <div class="layui-input-block">
                ${record.equipmentId}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设备名称</label>
            <div class="layui-input-block">
                ${record.equipmentName}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">登记人</label>
            <div class="layui-input-block">
                ${record.registrantName}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">学号、工号</label>
            <div class="layui-input-block">
                ${record.registrantNumber}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">故障类型</label>
            <div class="layui-input-block">
                ${classifyMap.get(record.classify)}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">故障详情</label>
            <div class="layui-input-block">
                <textarea class="layui-textarea" readonly>${record.detail}</textarea>
            </div>
        </div>
        <div class="layui-form-item" >
            <label class="layui-form-label">图片</label>
            <div class="layui-input-block">
                <img src="${photo.url}"/>
            </div>
        </div>

    </form>
</div>
<script src="/static/jquery/jquery.min.js"></script>
<script src="/static/layui/layui.js"></script>
<script src="/static/jqgrid/jquery.jqGrid.minffe4.js?0820"></script>
<script src="/static/jqgrid/myjqGrid.js?v=1.0.1"></script>
<script type="text/javascript">
    layui.use('form', function(){
        var form = layui.form;
        form.on('submit(*)', function(data){
            var recordId = '${record.id}';
            var form = $("#recordForm");
            var formData = form.serialize();
            formData.detail = $("#detail").html();
            $.post(form.attr("action"), formData, function(data){
                if(data.status == 200){
                    layer.alert(data.msg, {
                        icon: 1,
                        skin: 'layer-ext-moon'
                    },function () {
                        parent.myJqGrid.reloadGrid({});
                        parent.layer.closeAll();
                    });
                }else{
                    layer.alert(data.msg, {
                        icon: 2,
                        skin: 'layer-ext-moon'
                    });
                }
            });
            return false; //阻止表单跳转。
        });
    });
    function closeAll() {
        parent.layer.closeAll();
    }
</script>